const express = require("express");
const path = require("path")
const app = express();

//解决数据跨域问题的插件
const cors = require("cors");
app.use(cors());

app.use(express.static(path.join(__dirname,"public")));
//
const admin = require("./route/admin.js")
app.use("/api",admin);

//
//用户的查询(查询所有用户和单个查询都有)
const userquery = require('./router/user/userquery')
app.use('/user', userquery)

//用户新增
const userincrease = require('./router/user/userincrease')
app.use('/user', userincrease)

//用户删除
const userdelete = require('./router/user/userdelete')
app.use('/user', userdelete)

//用户修改
const usermodify = require('./router/user/usermodify')
app.use('/user', usermodify)

app.listen(666,()=>{
    console.log('开启')
    // console.log("http://localhost:666")
})